#include <vector>
#include <cassert>
#include "cmpcxx.h"

namespace cmpcxx {

using namespace std;

// math
double accuracy(const vector<int>& pred, const vector<int>& gt) {
	size_t sum = 0.;
	assert(pred.size() == gt.size());
	for (vector<int>::const_iterator citer = pred.begin(), citer_end = pred.end(), citer2 = gt.begin()
			; citer != citer_end; ++citer, ++citer2) {
		if (*citer == *citer2) {
			sum += 1.;
		}
	}
	double acc = static_cast<double>(sum) / pred.size();
	return acc;
}

}; //namespace cmpcxx
